﻿
Imports System.Reflection

Partial Public Class command_autoJob(Of hash_t, impl_t As command_autoJob(Of hash_t, impl_t))
    Protected Shadows Class field
        Public Shared ReadOnly field_required_commands() As fieldvalue(Of Byte()) = Nothing
        Public Shared ReadOnly field_respond_commands() As fieldvalue(Of Byte()) = Nothing
        Public Shared ReadOnly command_field_id As Int64 = 0

        Shared Sub New()
            Dim fields() As FieldInfo = Nothing
            fields = autoJob(Of hash_t, impl_t).field.fields
            ReDim field_required_commands(fields.Length() - 1)
            ReDim field_respond_commands(fields.Length() - 1)
            For i As Int64 = 0 To fields.Length() - 1
                If fields(i).Name() = "command" Then
                    command_field_id = i
                Else
                    field_required_commands(i) =
                        New fieldvalue(Of Byte())(impl_type, strcat(fields(i).Name(), "_required_commands"))
                    field_respond_commands(i) =
                        New fieldvalue(Of Byte())(impl_type, strcat(fields(i).Name(), "_respond_commands"))
                End If
            Next
        End Sub
    End Class
End Class
